#ifndef LOG_BUFFER_H
#define LOG_BUFFER_H

#include "../../base/Defind.hpp"

namespace DBServer
{
namespace Log
{

class Buffer {
public:
    Buffer();
    ~Buffer() = default;

    auto clear() -> void;
    auto append(const char*, int) -> void;
    auto size() -> int;
    auto get() -> const char*
    { return buf; }

private:
    char buf[LOGGER_BUFFER_SIZE];
    int cur, remain;
    const int total = LOGGER_BUFFER_SIZE;

};

} // namespace Log
} // namespace DBServer



#endif